xc_dominfo_t *info);
int xc_domain_getfullinfo(int xc_handle,
u32 domid,
+ u32 vcpu,
xc_domaininfo_t *info,
full_execution_context_t *ctxt);
int xc_domain_setcpuweight(int xc_handle,
u32 domid,
float weight);
long long xc_domain_get_cpu_usage(int xc_handle,
- domid_t domid);
+ domid_t domid,
+ int vcpu);
typedef dom0_shadow_control_stats_t xc_shadow_control_stats_t;
{
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)next_domid;
+ op.u.getdomaininfo.exec_domain = 0; // FIX ME?!?
op.u.getdomaininfo.ctxt = NULL; /* no exec context info, thanks. */
if ( do_dom0_op(xc_handle, &op) < 0 )
break;
int xc_domain_getfullinfo(int xc_handle,
u32 domid,
+ u32 vcpu,
xc_domaininfo_t *info,
full_execution_context_t *ctxt)
{
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)domid;
+ op.u.getdomaininfo.exec_domain = (u16)vcpu;
op.u.getdomaininfo.ctxt = ctxt;
rc = do_dom0_op(xc_handle, &op);
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)domid;
+ op.u.getdomaininfo.exec_domain = 0;
op.u.getdomaininfo.ctxt = ctxt;
if ( (do_dom0_op(xc_handle, &op) < 0) ||
((u16)op.u.getdomaininfo.domain != domid) )
/* Get the domain's shared-info frame. */
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)dom;
+ op.u.getdomaininfo.exec_domain = 0;
op.u.getdomaininfo.ctxt = NULL;
if ( do_dom0_op(xc_handle, &op) < 0 )
{
gettimeofday(&wall_now, NULL);
- d0_cpu_now = xc_domain_get_cpu_usage( xc_handle, 0 )/1000;
- d1_cpu_now = xc_domain_get_cpu_usage( xc_handle, domid )/1000;
+ d0_cpu_now = xc_domain_get_cpu_usage( xc_handle, 0, /* FIXME */ 0 )/1000;
+ d1_cpu_now = xc_domain_get_cpu_usage( xc_handle, domid, /* FIXME */ 0 )/1000;
if ( (d0_cpu_now == -1) || (d1_cpu_now == -1) )
printf("ARRHHH!!\n");
retry:
- if ( xc_domain_getfullinfo(xc_handle, ioctxt->domain, info, ctxt) )
+ if ( xc_domain_getfullinfo(xc_handle, ioctxt->domain, /* FIXME */ 0, info, ctxt) )
{
xcio_error(ioctxt, "Could not get full domain info");
return -1;
return 1;
}
- if ( xc_domain_getfullinfo( xc_handle, domid, &info, &ctxt) )
+ if ( xc_domain_getfullinfo( xc_handle, domid, /* FIXME */ 0, &info, &ctxt) )
{
xcio_error(ioctxt, "Could not get full domain info");
goto out;
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t) domid;
+ op.u.getdomaininfo.exec_domain = 0;
op.u.getdomaininfo.ctxt = ctxt;
if ((do_dom0_op(xc_handle, &op) < 0) ||
((u32) op.u.getdomaininfo.domain != domid)) {
}
-long long xc_domain_get_cpu_usage( int xc_handle, domid_t domid )
+long long xc_domain_get_cpu_usage( int xc_handle, domid_t domid, int vcpu )
{
dom0_op_t op;
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)domid;
+ op.u.getdomaininfo.exec_domain = (u16)vcpu;
op.u.getdomaininfo.ctxt = NULL;
if ( (do_dom0_op(xc_handle, &op) < 0) ||
((u16)op.u.getdomaininfo.domain != domid) )
dom0_op_t op;
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)domid;
+ op.u.getdomaininfo.exec_domain = 0;
op.u.getdomaininfo.ctxt = NULL;
return (do_dom0_op(xc_handle, &op) < 0) ?
-1 : op.u.getdomaininfo.tot_pages;
op.cmd = DOM0_GETDOMAININFO;
op.u.getdomaininfo.domain = (domid_t)domid;
+ op.u.getdomaininfo.exec_domain = 0;
op.u.getdomaininfo.ctxt = ctxt;
if ( (do_dom0_op(xc_handle, &op) < 0) ||
((u16)op.u.getdomaininfo.domain != domid) )
op->u.getdomaininfo.domain = d->id;
- ed = d->exec_domain[0]; // op->u.getdomaininfo.exec_domain];
+ if ( (op->u.getdomaininfo.exec_domain >= MAX_VIRT_CPUS) ||
+ !d->exec_domain[op->u.getdomaininfo.exec_domain] )
+ {
+ ret = -EINVAL;
+ break;
+ }
+
+ ed = d->exec_domain[op->u.getdomaininfo.exec_domain];
op->u.getdomaininfo.flags =
(test_bit( DF_DYING, &d->d_flags) ? DOMFLAGS_DYING : 0) |